#include <normalLabel.h>

namespace lgb_gtk
{

  NormalLabel::NormalLabel()
  {
    x = 0;
    y = 0;
    width = 100;
    height = 40;
  }

  NormalLabel::~NormalLabel()
  {

  }

  int NormalLabel::Init()
  {
    if(hasInit)
      return 1;

    label = gtk_label_new(text.c_str());
    goo_canvas_widget_new(canvas , label , x , y , width , height , NULL);

    hasInit = true;
    return 0;
  }

  int NormalLabel::SetText(string newText)
  {
    text = newText;
    //if(NULL != label)
    if(hasInit)
      gtk_label_set_text((GtkLabel*)label , text.c_str());
    return 0;
  }

  string NormalLabel::GetText()
  {
    if(hasInit)
      text = gtk_label_get_text((GtkLabel*)label);
    return text;
  }

}
